-
Notifications
You must be signed in to change notification settings - Fork 55
fix: click area keep same with app on dock #1216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. Restructured tooltip timer and positioning logic outside the Image component 2. Replaced TapHandler with MouseArea for better click handling consistency 3. Fixed tooltip positioning by using toggleworkspace coordinates instead of Applet.rootObject 4. Maintained hover behavior but with cleaner separation of concerns The changes improve the reliability of the workspace switching functionality and tooltip display in the dock's multitask view. The new MouseArea provides more consistent click handling compared to the previous TapHandler implementation. The tooltip positioning is now more accurate as it uses the correct coordinate space. fix: 修复点击范围保持跟应用一致. 1. 将工具提示计时器和定位逻辑从Image组件中移出并重构 2. 用MouseArea替换TapHandler以获得更一致的点击处理 3. 通过使用toggleworkspace坐标而非Applet.rootObject修复工具提示定位 4. 保持悬停行为但实现了更清晰的关注点分离 这些改动提高了dock中多任务视图的工作区切换功能和工具提示显示的可靠性。新 的MouseArea相比之前的TapHandler提供了更一致的点击处理。工具提示定位现在 更加准确,因为它使用了正确的坐标空间。 Pms: BUG-323763
deepin pr auto review代码审查意见:
综合以上意见,代码可以进一步优化,以提高代码质量、可读性和性能。 |
Reviewer's GuideRestructured tooltip and input handling in the dock’s multitask view by moving timer logic out of the Image component, replacing TapHandler with MouseArea for consistent clicks, using toggleworkspace coordinates for tooltip positioning, and extracting hover behavior for cleaner separation of concerns. Sequence diagram for click and tooltip behavior with MouseAreasequenceDiagram
participant User as actor User
participant MouseArea
participant Applet
participant toolTip
User->>MouseArea: Click (Left Button)
MouseArea->>Applet: openWorkspace()
MouseArea->>toolTip: close()
Sequence diagram for hover and tooltip displaysequenceDiagram
participant User as actor User
participant HoverHandler
participant Timer
participant toolTip
User->>HoverHandler: Hover in
HoverHandler->>Timer: start()
Timer->>toolTip: open() (after interval)
User->>HoverHandler: Hover out
HoverHandler->>Timer: stop()
HoverHandler->>toolTip: close()
Class diagram for updated input and tooltip handling in multitaskview.qmlclassDiagram
class AppletItem {
}
class MouseArea {
+onClicked(mouse)
}
class Timer {
+onTriggered()
}
class HoverHandler {
+onHoveredChanged
}
class toolTip {
+open()
+close()
DockPanelPositioner.bounding
}
AppletItem o-- MouseArea : contains
AppletItem o-- Timer : contains
AppletItem o-- HoverHandler : contains
AppletItem o-- toolTip : uses
MouseArea --> toolTip : closes on click
Timer --> toolTip : opens on trigger
HoverHandler --> Timer : starts/stops
HoverHandler --> toolTip : closes on hover out
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| onTapped: { | ||
| } | ||
|
|
||
| MouseArea { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换成MouseArea由什么好处么,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
保持根启动器一致把, 启动器之前用TapHandler 出现过BUG, 这是启动器的注视The TapHandler receives the event after visibleChange, which causes the state to be inverted after synchronization,
// causing the launchpad to be displayed again. However, the MouseArea receives the event before visibleChange.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: behind) |
The changes improve the reliability of the workspace switching functionality and tooltip display in the dock's multitask view. The new MouseArea provides more consistent click handling compared to the previous TapHandler implementation. The tooltip positioning is now more accurate as it uses the correct coordinate space.
fix: 修复点击范围保持跟应用一致.
这些改动提高了dock中多任务视图的工作区切换功能和工具提示显示的可靠性。新
的MouseArea相比之前的TapHandler提供了更一致的点击处理。工具提示定位现在
更加准确,因为它使用了正确的坐标空间。
Pms: BUG-323763
Summary by Sourcery
Refactor tooltip display and click handling in the dock's multitask view to improve reliability and accuracy
Bug Fixes:
Enhancements: